<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件上传</title>
<style type="text/css">
.des{
	background-image: url("/image/head/searh_backgroud_shadow.gif");
	padding-top: 5px;
	padding-bottom: 5px;
	font-size: 16px;
	color: blue;
	font-weight: bold;
	margin-bottom: 5px;
}
.send{
	background-color:gray;
	background-image: url("/image/head/searh_backgroud.gif");
	width: 50xp;
	font-size: 16px;
	color: blue;
	font-weight: bold;
}
</style>
<script type="text/javascript">
function checkfm(){
	var file=document.getElementById("filePath").value;
	if(file!=""){
		var types = ["jpg","jpeg","gif","bmp","png"];
		var ext = file.substring(file.lastIndexOf('.')+1,file.length).toLowerCase();
		var sing = false;
		for(var i=0; i<types.length;i++){
			if (ext==types[i]){
				sing = true; 
				
			}
		}
		if(!sing){
			alert("只允许上传图片");
		}else{
			document.getElementById("formFile").submit();
		}		
	}else{
		alert("请选择上传文件");
	}
}
</script>
</head>
<body>
<center>
	<form id="formFile" 
		action="${pageContext.request.contextPath}/control/book/upload_uploadShopLogo.go" 
		method="post" enctype="multipart/form-data" onsubmit="return checkfm()">
		<div class="des">只允许上传图片</div>
		本地文件：<input class="send" type="file" name="upload"><br/>
		<input class="send" type="submit" value="确  定">
	</form>
</center>
</body>
</html>